import request from '@/utils/request'

// 查询考试大厅列表
export function listExame(query) {
  return request({
    url: '/exam/exame/list',
    method: 'get',
    params: query
  })
}

// 查询考试大厅详细
export function getExame(exameId) {
  return request({
    url: '/exam/exame/' + exameId,
    method: 'get'
  })
}

// 新增考试大厅
export function addExame(data) {
  return request({
    url: '/exam/exame',
    method: 'post',
    data: data
  })
}

// 修改考试大厅
export function updateExame(data) {
  return request({
    url: '/exam/exame',
    method: 'put',
    data: data
  })
}

// 删除考试大厅
export function delExame(exameId) {
  return request({
    url: '/exam/exame/' + exameId,
    method: 'delete'
  })
}
// 查询试卷管理列表
export function listPaper(courseId) {
  return request({
    url: '/examination/paper/list',
    method: 'get',
    params: {
      pageNum: 1,
      pageSize: 1000,
      courseId
    }
  })
}

// 发布考试大厅
export function pushCourseExame(data) {
  return request({
    url: '/exam/exame/pushCourseExame',
    method: 'post',
    data: data
  })
}

// 进入考试用户信息查询
export function getExameUserInfo(exameId) {
  return request({
    url: '/exam/exame/goExame/' + exameId,
    method: 'get'
  })
}
// 查询试卷管理详细
export function getPaper(paperId) {
  return request({
    url: '/examination/paper/show/' + paperId,
    method: 'get'
  })
}
// 查询试卷管理详细
export function uploadAnswer(data) {
  return request({
    url: '/exam/exame/answer',
    method: 'post',
    data
  })
}
// 获取学生考试/作业答题页面详情
export function getExercisesDetail(id) {
  return request({
    url: "/examination/exerciseDetail/getForStu/" + id,
    method: "get"
  });
}
